import socket

sv_addr = ('127.0.0.1',10080)

cl = socket.socket(
    socket.AF_INET,
    socket.SOCK_DGRAM,
    socket.IPPROTO_UDP
)

while True:
    msg = input("请输入信息：")
    if not msg:
        break
    data = msg.encode()
    cl.sendto(data, sv_addr)

cl.close()
